package com.woniu.airent.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * description:基本配置
 *
 * @author AlenHx
 * @create 2020/9/27
 * @since 1.0.0
 */
@Configuration
public class MyMvcConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
    }

    @Override
    protected void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("view/login_register");
        registry.addViewController("/index.html").setViewName("view/index");
        registry.addViewController("/searchhouse.html").setViewName("view/searchhouse");
        registry.addViewController("/roomate.html").setViewName("view/roomate");
        registry.addViewController("/bbs.html").setViewName("view/bbs");
        registry.addViewController("/login_register.html").setViewName("view/login_register");
        registry.addViewController("/selectcity.html").setViewName("view/selectcity");
        registry.addViewController("/logout").setViewName("logout");
        registry.addViewController("/searchmap.html").setViewName("view/searchmap");
        registry.addViewController("/roomatedesc.html").setViewName("view/roomatedesc");
        registry.addViewController("/searchhouse.html").setViewName("view/searchhouse");
        registry.addViewController("/roomate.html").setViewName("view/roomate");
        registry.addViewController("/PriceTrendChart.html").setViewName("view/PriceTrendChart");
        registry.addViewController("/Agreement.html").setViewName("view/Agreement");
        registry.addViewController("/Potplayer.html").setViewName("view/Potplayer");
        registry.addViewController("/Commitment.html").setViewName("view/Commitment");
        registry.addViewController("/about.html").setViewName("view/about");
        registry.addViewController("/roommate").setViewName("view/roommate");
        registry.addViewController("/toDashBoard").setViewName("view/dashboard");
        registry.addViewController("/userManage").setViewName("manager/userManage");
        registry.addViewController("/user.html").setViewName("view/user");
        registry.addViewController("/report1").setViewName("view/report1");
        registry.addViewController("/updateissuehouse.html").setViewName("view/updateissuehouse");

        registry.addViewController("/reviewReportInfor.html").setViewName("view/ReviewReportInfor");
        registry.addViewController("/article.html").setViewName("view/Article");
        registry.addViewController("/postArticle.html").setViewName("view/postArticle");
        registry.addViewController("/issuehouse.html").setViewName("view/issuehouse");
        registry.addViewController("/houseInformerManage.html").setViewName("manager/houseInformerManage");
        registry.addViewController("/articleManage.html").setViewName("manager/articleManage");
        registry.addViewController("/showOneAr.html").setViewName("view/showOneAr");
        registry.addViewController("/baiduMap.html").setViewName("view/baiduMap");
        registry.addViewController("/reportArticle.html").setViewName("view/reportArticle");
        registry.addViewController("/showArticleReporter.html").setViewName("view/showArticleReporter");

        registry.addViewController("/report").setViewName("view/report");
        registry.addViewController("/Potplayer").setViewName("view/Potplayer");
        registry.addViewController("/Agreement").setViewName("view/Agreement");
        registry.addViewController("/Commitment").setViewName("view/Commitment");
    }

}
